home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / ODF / OS / FWGraphx / FWStyle.h < prev    next >
Encoding:
Text File  |  1996-09-17  |  5.0 KB  |  174 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWStyle.h
  4. //    Release Version:    $ ODF 2 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FWSTYLE_H
  11. #define FWSTYLE_H
  12.  
  13. #ifndef FWSTDDEF_H
  14. #include "FWStdDef.h"
  15. #endif
  16.  
  17. #ifndef FWGCONST_H
  18. #include "FWGConst.h"
  19. #endif
  20.  
  21. #ifndef FWCOLOR_H
  22. #include "FWColor.h"
  23. #endif
  24.  
  25. #ifndef SLSHATTR_H
  26. #include "SLShAttr.h"
  27. #endif
  28.  
  29. #ifndef FWGRREF_H
  30. #include "FWGrRef.h"
  31. #endif
  32.  
  33. #ifndef FWPAT_H
  34. #include "FWPat.h"
  35. #endif
  36.  
  37. //========================================================================================
  38. //    Forward class declarations
  39. //========================================================================================
  40.  
  41. class FW_CReadableStream;
  42. class FW_CWritableStream;
  43.  
  44. //========================================================================================
  45. //    CLASS FW_CStyle
  46. //========================================================================================
  47.  
  48. class FW_CStyle : public FW_TGrRefPtr<FW_HStyle>
  49. {
  50. public:
  51.     FW_DECLARE_AUTO(FW_CStyle)
  52.  
  53.     ~FW_CStyle();
  54.     
  55.     FW_CStyle(FW_Fixed penSize, FW_EStyleDash dash = FW_kSolidLine);
  56.     FW_CStyle(FW_Fixed penSize, const FW_CPattern& pattern);
  57.     
  58.     FW_CStyle(const FW_CStyle& other);
  59.     FW_CStyle& operator=(const FW_CStyle& other);        
  60.                     
  61.     FW_CStyle(FW_EStandardStyles std = FW_kNormalStyle);
  62.     FW_CStyle& operator=(FW_EStandardStyles std);
  63.     
  64.     FW_CStyle Copy() const;
  65.  
  66.     friend FW_CWritableStream& operator << (FW_CWritableStream& stream, const FW_CStyle& style);
  67.     friend FW_CReadableStream& operator >> (FW_CReadableStream& stream, FW_CStyle& style);
  68.     
  69.     // ----- Delegation
  70.     
  71.     long                    GetRefCount() const;
  72.  
  73.     // Attributes
  74.     
  75.     FW_Fixed         GetPenSize() const;
  76.         
  77.     FW_CPattern        GetPattern() const;
  78.  
  79.     FW_CPattern     GetUnSharedPattern();
  80.         
  81.     FW_EStyleDash    GetDashStyle() const;
  82.  
  83.     // Comparison
  84.  
  85.     FW_Boolean        IsEqual(const FW_CStyle& other) const;
  86.  
  87.     // Operations
  88.     
  89.     void            SetPenSize(FW_Fixed penSize);
  90.  
  91.     void            SetPattern(const FW_CPattern& pattern);
  92.         
  93.     void            SetDashStyle(FW_EStyleDash dash);
  94. };
  95.  
  96. //========================================================================================
  97. //    Inlines
  98. //========================================================================================
  99.  
  100. //----------------------------------------------------------------------------------------
  101. //    FW_CStyle::GetRefCount
  102. //----------------------------------------------------------------------------------------
  103. inline long    FW_CStyle::GetRefCount() const
  104. {
  105.     return FW_PrivStyle_GetRefCount(fRep);
  106. }
  107.  
  108. //----------------------------------------------------------------------------------------
  109. //    FW_CStyle::GetPenSize
  110. //----------------------------------------------------------------------------------------
  111. inline FW_Fixed FW_CStyle::GetPenSize() const
  112. {
  113.     return FW_PrivStyle_GetPenSize(fRep);
  114. }
  115.  
  116. //----------------------------------------------------------------------------------------
  117. //    FW_CStyle::GetPattern
  118. //----------------------------------------------------------------------------------------
  119. inline FW_CPattern    FW_CStyle::GetPattern() const
  120. {
  121.     return FW_PrivStyle_GetPattern(fRep);
  122. }
  123.  
  124. //----------------------------------------------------------------------------------------
  125. //    FW_CStyle::GetUnSharedPattern
  126. //----------------------------------------------------------------------------------------
  127. inline FW_CPattern FW_CStyle::GetUnSharedPattern()
  128. {
  129.     return FW_PrivStyle_GetUnSharedPattern(fRep);
  130. }
  131.  
  132. //----------------------------------------------------------------------------------------
  133. //    FW_CStyle::GetDashStyle
  134. //----------------------------------------------------------------------------------------
  135. inline FW_EStyleDash FW_CStyle::GetDashStyle() const
  136. {
  137.     return FW_PrivStyle_GetDashStyle(fRep);
  138. }
  139.  
  140. //----------------------------------------------------------------------------------------
  141. //    FW_CStyle::IsEqual
  142. //----------------------------------------------------------------------------------------
  143. inline FW_Boolean FW_CStyle::IsEqual(const FW_CStyle& other) const
  144. {
  145.     return FW_PrivStyle_IsEqual(fRep, other.fRep);
  146. }
  147.  
  148. //----------------------------------------------------------------------------------------
  149. //    FW_CStyle::SetPenSize
  150. //----------------------------------------------------------------------------------------
  151. inline void    FW_CStyle::SetPenSize(FW_Fixed penSize)
  152. {
  153.     FW_PrivStyle_SetPenSize(fRep, penSize);
  154. }
  155.  
  156. //----------------------------------------------------------------------------------------
  157. //    FW_CStyle::SetPattern
  158. //----------------------------------------------------------------------------------------
  159. inline void    FW_CStyle::SetPattern(const FW_CPattern& pattern)
  160. {
  161.     FW_PrivStyle_SetPattern(fRep, pattern);
  162. }
  163.  
  164. //----------------------------------------------------------------------------------------
  165. //    FW_CStyle::SetDashStyle
  166. //----------------------------------------------------------------------------------------
  167. inline void    FW_CStyle::SetDashStyle(FW_EStyleDash dash)
  168. {
  169.     FW_PrivStyle_SetDashStyle(fRep, dash);
  170. }
  171.  
  172.  
  173. #endif
  174.